home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17512 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: news.crd.ge.com!rebecca!rpi!not-for-mail
  2. From: vm@panix.com (Victor Muslin)
  3. Newsgroups: comp.lang.c++,comp.lang.c++.moderated
  4. Subject: Help with IOStreams needed!
  5. Date: 16 Apr 1996 00:25:12 -0000
  6. Organization: Access Net Direct
  7. Sender: cppmods@netlab.cs.rpi.edu
  8. Approved: herbs@connobj.com
  9. Message-ID: <4kupd8$khj@netlab.cs.rpi.edu>
  10. NNTP-Posting-Host: netlab.cs.rpi.edu
  11. X-Original-Date: 14 Apr 1996 19:33:18 GMT
  12.  
  13. I am new to IOStreams, so please pardon if this is a silly question...
  14.  
  15. I open a file as an ofstream. When I write to it I would like to lock it to
  16. ensure that no other process can write until I am done. In C I could've used
  17. an flock() to which I would pass a file descriptor obtained from open(). How
  18. do I do I find the file descriptor associated with an ofstream (or ostream for
  19. that matter)? Or, is there a better way to lock an output stream in C++?
  20.  
  21. If you could copy your reply to vmuslin@prodigy.com I would appreciate it.
  22.  
  23.    {Those who post questions to a newsgroup are expected to read the
  24.    newsgroup for the reply.  See the netnews netiquette guide. -mod}
  25.  
  26. Thanks.
  27.  
  28.  
  29.       [ Articles to moderate: mailto:c++-submit@netlab.cs.rpi.edu ]
  30.       [  Read the C++ FAQ: http://www.connobj.com/cpp/cppfaq.htm  ]
  31.       [  Moderation policy: http://www.connobj.com/cpp/guide.htm  ]
  32.       [      Comments? mailto:c++-request@netlab.cs.rpi.edu       ]
  33.